home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / LINE-1.BAS < prev    next >
BASIC Source File  |  1989-08-31  |  738b  |  25 lines

  1. ' LINE-1.BAS
  2. ' This program demonstrates the LINE statement.
  3.  
  4. CLS
  5.  
  6. INPUT "Please enter a screen mode (0-13):  ", modeNum%
  7. INPUT "How many colors?  ", numColors%
  8. SCREEN modeNum%
  9.  
  10. CONST DELAY% = 100                           ' controls delay between
  11.                                              '   each line drawn
  12. DO
  13.     shade% = INT(RND(1) * numColors%) + 1    ' line color
  14.     x1pos% = INT(RND(1) * 320)               ' start coordinates
  15.     y1pos% = INT(RND(1) * 200)
  16.     x2pos% = INT(RND(1) * 320)               ' end coordinates
  17.     y2pos% = INT(RND(1) * 200)
  18.     LINE (x1pos%, y1pos%)-(x2pos%, y2pos%), shade%
  19.    
  20.     FOR i% = 1 TO DELAY%                     ' delay loop
  21.     NEXT i%
  22.  
  23. LOOP WHILE INKEY$ = ""
  24.  
  25.